<?php

/*
 * 新锐手机注册 [ 深圳市新锐创意科技有限公司旗下产品 ]
 * Copyright  2015-2099 www.xinruiweb.com  All Rights Reserved.
 * 技术开发: 75674952@qq.com
 * 请支持正版授权产品
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class table_xinrui_mobilereg_user extends discuz_table {

	public function __construct() {
		$this->_table = 'xinrui_mobilereg_user';
		$this->_pk = 'id';

		parent::__construct();
	}


    public function fetch($code,$mobile,$time) {
		return DB::fetch_first('SELECT * FROM %t WHERE code=%d and mobile=%s and status = 0 and createtime > %s', array($this->_table, $code,$mobile,$time));
	}

    public function fetch_first_by_uid($uid) {
        return DB::fetch_first("SELECT * FROM %t WHERE uid=%s", array($this->_table, $uid));
    }

    public function fetch_first_by_moblie($phone) {
        return DB::fetch_first("SELECT * FROM %t WHERE mobile=%s", array($this->_table, $phone));
    }

    public function fetch_first_by_bind($uid) {
        return DB::fetch_first("SELECT * FROM %t WHERE bind=%s", array($this->_table, $uid));
    }

}
